﻿<%@ Page Language="VB" MasterPageFile="~/WebForm/MasterPage.master" ValidateRequest="false"
    AutoEventWireup="false" CodeFile="CustomerGroupPercentage.aspx.vb" Inherits="WebForm_CustomerGroupPercentage" %>

<asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder1" runat="Server">

    <script type="text/javascript">
function openQuery()
{
    var win_width = 630;
    var win_height = 500;
    var PosX = (screen.width-win_width)/2; 
    var PosY = (screen.Height-win_height)/2; 
    features = "width="+win_width+",height="+win_height+",top="+PosY+",left="+PosX;
    
    var url = '<%= ResolveUrl("~/WebForm/CustomerGroupPercentageQuery.aspx") %>' + '?Signature=' + $get('<%=ddlSignature.ClientID %>').value
    window.open(url,'','toolbar=0,titlebar=0,resizable,'+features);
}
    </script>

    <script type="text/javascript">
      function JHshNumberText()   
      {   
          if(!(((window.event.keyCode>=48)&&(window.event.keyCode<=57))||(window.event.keyCode==13)||(window.event.keyCode==46)||(window.event.keyCode==45)))   
          {   
                window.event.keyCode=0;   
          }   
      }   
    </script>

    <asp:UpdatePanel ID="up" runat="server" UpdateMode="conditional">
        <contenttemplate>

    <asp:Panel ID="panel1" runat="server"  Style="cursor: move;" >
        <br />
        <div align="center">
            <asp:Label ID="lblTitle" Font-Bold="true" runat="server" Text="<%$ Resources:Title %>" SkinID="title"></asp:Label>
        </div>
                    <div style="background-color: #351D26">
        <table width="100%">
            <tr>
                <td>

                    <FIELDSET ID="FIELDSET1" style="border-color:#4E333B" runat="server">
                    <LEGEND class="white2">
                        <asp:Literal ID="Literal1" runat="server" Text="Query" />
                    </LEGEND>
                    <asp:Label ID="lblDivision" runat="server" Text="<%$ Resources:lblDivision %>"></asp:Label>
                    <asp:DropDownList ID="ddlDivision" runat="server" AutoPostBack="True">
                    </asp:DropDownList>
                    <asp:Label ID="lblLevel1Name" runat="server" Text="<%$ Resources:Level1Name %>"></asp:Label>
                    <asp:DropDownList ID="ddlSignature" runat="server" AutoPostBack="True" >
                    </asp:DropDownList>
                    <asp:Label ID="lblLevel2Name" runat="server" Text="<%$ Resources:Level2Name %>"></asp:Label>
                    <asp:DropDownList ID="ddlLevel2Name" runat="server">
                    </asp:DropDownList>                 
                    <asp:Button ID="btnQuery" runat="server" Text="<%$ Resources:Query %>" />
                    &nbsp;
                    <input type="button" id="btnOpen" visible="false" class="button2" runat="server" value="Query" onclick='openQuery();' />
                    </FIELDSET>

                </td>
            </tr>
            <tr>
                <td>
                    <FIELDSET ID="FIELDSET2" style="border-color:#4E333B" runat="server">
                    <LEGEND class="white2">
                        <asp:Literal ID="Literal2" runat="server" Text="List" />
                    </LEGEND>
                    <My:MyGridView ID="gv" runat="server" AllowHoverEffect="True" AllowPaging="false"
                        AllowHoverSelect="false" TotalRowCount="0" AutoGenerateColumns="False"
                        SkinID="pager" DataKeyNames="Division,Signature,Level2Name,Level2Value,Channel" >
                        <Columns>                      
                            <asp:BoundField DataField="Division" HeaderText="<%$ Resources:Division %>"
                                SortExpression="Division" ReadOnly="True" />
                            <asp:BoundField DataField="Level1Name" HeaderText="<%$ Resources:gvLevel1Name %>"
                                SortExpression="Level1Name" ReadOnly="True" />
                            <asp:BoundField DataField="Level2Name" HeaderText="<%$ Resources:Level2Name %>"
                                SortExpression="Level2Name" ReadOnly="True" />
                            <asp:BoundField DataField="ChannelName" HeaderText="<%$ Resources:Channel %>"
                                SortExpression="ChannelName" ReadOnly="True" />                        
                            <asp:TemplateField HeaderText="<%$ Resources:Percentage %>" SortExpression="Percentage">
                                <EditItemTemplate>
                                    <asp:TextBox ID="txtPercentage" runat="server" onkeypress="JHshNumberText()"
                                Text='<%# Eval("Percentage").ToString().Replace("%","") %>' MaxLength="50" Width="90%"></asp:TextBox>
                                </EditItemTemplate>
                                <ItemTemplate>
                                    <asp:TextBox ID="txtPercentage" runat="server" onkeypress="JHshNumberText()"
                                Text='<%# Eval("Percentage").ToString().Replace("%","") %>' MaxLength="50" Width="40px"></asp:TextBox>%
                                </ItemTemplate>
                            </asp:TemplateField>
                            <asp:TemplateField visible="false">
                                <EditItemTemplate>
                                    <asp:LinkButton ID="lbtnUpdate" runat="server" Text="<%$ Resources:Update %>" ValidationGroup="Update"
                                CommandName="Update"></asp:LinkButton>
                                    <asp:LinkButton ID="lbtnCancel" runat="server" Text="<%$ Resources:Cancel %>" CommandName="Cancel"
                                CausesValidation="False"></asp:LinkButton>
                                    &nbsp;
                                </EditItemTemplate>
                                <ItemTemplate>
                                    <asp:LinkButton ID="lbtnEdit" runat="server" Text="<%$ Resources:Edit %>" CommandName="Edit"
                                CausesValidation="False"></asp:LinkButton>                               
                                </ItemTemplate>
                                <ItemStyle HorizontalAlign="Center" width="60px" />
                            </asp:TemplateField>  
                        </Columns>
                    </My:MyGridView>
                    </FIELDSET>
                </td>
            </tr>
            <tr align="center">
                <td>
                    <asp:Button id="btnSave" runat="server" Text="<%$ Resources:btnSave %>"></asp:Button>
                </td>
            </tr>
        </table>  
                    </div>
    </asp:Panel>
    </contenttemplate>
    </asp:UpdatePanel>
</asp:Content>
